local losejcSkill = fk.CreateSkill {
  name = "#losejcSkill",
  tags = { Skill.Compulsory, },
}

losejcSkill:addEffect(fk.TurnEnd, {
  can_refresh = function(self, event, target, player, data)
    return player:hasSkill(losejcSkill.name) and target == player and player:getMark("losejc") ~= 0
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    local skills = player:getMark("losejc")
    local skillstb = skills:split("|")
    -- local loseskills = "-"..skill.."|-"..losejcSkill.name
    local loseskills = ""
    for _,ski in ipairs(skillstb) do
      loseskills = loseskills.."-"..ski.."|"
    end
    loseskills = loseskills..losejcSkill.name
    room:handleAddLoseSkills(player, loseskills, nil, false)
    room:setPlayerMark(player,"losejc",0)
  end,
})


return losejcSkill